﻿using System.Windows;
using Brjnk.GpxExplorer.ViewModel;

namespace Brjnk.GpxExplorer.UI
{
    /// <summary>
    /// Interaction logic for GeocacheDetailWindow.xaml
    /// </summary>
    public partial class GeocacheDetailWindow : Window
    {
        public GeocacheDetailWindow(WaypointVM wpt)
        {
            InitializeComponent();
            headerId.Text = wpt.Source.Name;
            headerName.Text = wpt.Source.Geocache.Name;
            string shortHtml = wpt.Source.Geocache.HtmlShort;
            string longHtml = wpt.Source.Geocache.HtmlBody;
            if (string.IsNullOrEmpty(shortHtml)) shortHtml = "-empty-";
            if (string.IsNullOrEmpty(longHtml)) longHtml = "-empty-";
            @short.NavigateToString(shortHtml);
            @long.NavigateToString(longHtml);
            logs.ItemsSource = wpt.Source.Geocache.Logs;
        }
    }
}